package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.product.service.BrandService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vo.common.entity.product.Brand;
import vo.common.vo.common.Result;
import vo.common.vo.common.ResultCodeEnum;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "品牌管理")
@RestController
@RequestMapping(value="/api/product/brand")
public class BrandController {
   
   @Resource
   private BrandService brandService;
   
   @Operation(summary = "获取全部品牌")
   @GetMapping("/findAll")
   public Result<List<Brand>> findAll() {
      List<Brand> list = brandService.findAll();
      return Result.build(list, ResultCodeEnum.SUCCESS);
   }

}